<?php
    header('content-type:text/html;charset=utf-8') ;

    // php连数据库

    @include_once('connect.php');
    // echo 'ok';


    // 列表的接口
    // 1 连数据库
    // 2 查询数据库

    $id = $_GET['id'];


    // 返回给前端的结果
    $obj = [];

    

    // 定义sql语句
    $sql = "select * from flower_detail , flower where flower.goods_id= $id and flower_detail.goods_id = flower.goods_id";
    // 执行sql语句   执行之后会得到一个结果集
    $res = mysqli_query($conn , $sql);
    $data = mysqli_fetch_array($res);
    if($res) {
        $obj['status'] = true ;
        $obj['data'] = $data ;
    } else {
        $obj['status'] = false ;
        $obj['msg'] = '查询数据失败' ;
    }
    


    echo json_encode($obj);
?>